<?php

namespace App\Support\CustomForm\Helper;

trait HelpTrait
{
    public static function buildOptionsFromEnum(array $enum): array
    {
        return collect($enum)->map(function ($value, $key) {
            return [
                "text"  => $value,
                "key"   => $value,
                "value" => $key
            ];
        })->values()->toArray();
    }
}
